Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to cancel "restore" and "real_destroy" actions #283

Open
wants to merge 1 commit into
base: rails4
Choose a base branch
from

Conversation

arieliten
Copy link

Currently the callbacks for before_restore and before_real_destroy can't be canceled (via returning false) like any other normal ActiveModel::Callback. So here I'm adding the support to cancel any of those actions (restore or real_destroy) by returning false in their callbacks.

@rbr
Copy link
Contributor

rbr commented Feb 22, 2016

Canceling callbacks with falseseems to be deprecated in Rails 5: rails/rails#17227, throw(:abort) is the new way.

@valentindruon
Copy link

What if we are not using Rails 5.0?

@therrick
Copy link

I'd love to see this get merged. We've been using a custom fork with this change for several months now and would much rather have it in the main repo. Any outlook for accepting it?

@BenMorganIO
Copy link
Collaborator

BenMorganIO commented Jul 12, 2016

Good job @arieliten. Can you provide a test for this change?

@kasparsj
Copy link

kasparsj commented Nov 9, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants